﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Common;
using System.Data.Entity;
using eStudying.Core.Objects;


namespace eStudying.Repository.Repository
{
    public class ArticleRepository
    {

        EStudyingContext context;

        public ArticleRepository()
        {

            this.context = new EStudyingContext();
        }
            public void Add(Article article)
        {

            context.Articles.Add(article);
            context.SaveChanges();
        }

            public Article Find(int id)
            {
                return context.Articles.Find(id);
            }

            public List<Article> Find()
            {
                return context.Articles.ToList();
            }
    }
}
